package com.sinoglobal.dumping.dumplingtype;

import com.sinoglobal.dumping.activity.Dumpling_MainActivity;
import com.sinoglobal.dumping.base.Dumpling_NumberUtil;
import com.sinoglobal.dumping.fragment.Dumpling_HomeFragment;
import com.sinoglobal.dumping.util.Dumpling_HttpMethodSet;

import static com.sinoglobal.dumping.base.Dumpling_SinoConstans.DUMPLING_MONEY;
import static com.sinoglobal.dumping.util.DumplingUtils.getMoney;

/**
 * Created by KeZhuang on 2016/1/26.
 */
public class DumplingTypeMoney extends AbsDumplingType {
    public DumplingTypeMoney(Dumpling_HomeFragment fragment) {
        super(fragment);
    }

    @Override
    public void operation() {

        double dumplingMoney = Dumpling_NumberUtil.add(
                getMoney(mContext),
                Double.parseDouble(mDumpling.getPrizeAmount())
        );

        putCache(DUMPLING_MONEY, dumplingMoney);

        Dumpling_HttpMethodSet.getShareContent(
                mContext,
                Dumpling_MainActivity.TEMP_ID_MONEY,
                mDumpling.getUserImg(),
                mDumpling.getPutUser(),
                String.valueOf(getMoney(mContext)),
                ""
        );
    }
}
